package offer;

public class offer_0060 {
    public double[] dicesProbability(int n) {
        double[][] dp=new double[n+1][6*n+1];
        for(int i=1;i<7;++i){
            dp[1][i]=1.0/6;
        }
        for(int k=2;k<=n;++k){
            for(int i=k-1;i<=6*k-6;++i){
                for(int l=i+1;l<=i+6;++l){
                    dp[k][l]+=dp[k-1][i]/6;
                }
            }
        }
        double[] result=new double[5*n+1];
        for(int i=0;i<5*n+1;++i){
            result[i]=dp[n][n+i];
        }
        return result;
    }
}
